package com.gglx.app.clip.itemRenderers
{
	import flash.filters.DropShadowFilter;

	import spark.components.LabelItemRenderer;

	public class MainMenuItemRendererVertical extends LabelItemRenderer
	{
		private static var inited:Boolean=false;

		private static var labelShadow:DropShadowFilter;

		public function MainMenuItemRendererVertical()
		{
			if (!inited)
			{
				labelShadow=new DropShadowFilter(1, 90, 0x000000, 1, 0, 0, 255);

				inited=true;
			}

			super();
		}

		override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void
		{
			if (selected || down)
			{
				graphics.beginFill(0x0);
				graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
				graphics.endFill();
			}
			else
			{
				graphics.beginFill(0x3d3d3d);
				graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
				graphics.endFill();
			}

			drawBorder(unscaledWidth, unscaledHeight);
		}

		override protected function createLabelDisplay():void
		{
			super.createLabelDisplay();

			labelDisplay.setStyle("fontWeight", "bold");
			labelDisplay.setStyle("color", 0xa9a9a9);
			//labelDisplay.filters=[labelShadow];
		}


		override protected function drawBorder(unscaledWidth:Number, unscaledHeight:Number):void
		{
			if (selected || down)
			{
				graphics.beginFill(0xCC0000);
				graphics.drawRect(0, 2, 8, unscaledHeight - 3);
				graphics.endFill();
			}

			// ngang
			graphics.beginFill(0x686868);
			graphics.drawRect(0, 0, unscaledWidth, 1);
			graphics.endFill();

			graphics.beginFill(0x181818);
			graphics.drawRect(0, unscaledHeight - 1, unscaledWidth, 1);
			graphics.endFill();

			// dọc
			graphics.beginFill(0x686868);
			graphics.drawRect(0, 0, 1, unscaledHeight);
			graphics.endFill();

			graphics.beginFill(0x181818);
			graphics.drawRect(unscaledWidth - 1, 0, 1, unscaledHeight);
			graphics.endFill();
		}
	}
}
